Skip to content

Conversation

@duncanista
Copy link
Contributor

@duncanista duncanista commented Jan 29, 2025

What?

Adds aggregators for Traces and Stats.

Motivation

Large trace payloads are being dropped, because they're rejected by the backend.
Also SVLS-6250

Test

  • Added unit tests
  • Tested in an AWS Lambda with a heavy amount of incoming traces

method to remove the boilerplate to start a trace agent, and only return the flushers, channel, and processor
from `manual_flush` to `flush` and `flush` to `send`
generic `prost::Message` aggregator which batches given a `max_content_size_bytes`
a flusher should only flush, not receive messages, we abstract that from here
now the `TraceAgent` spins up a task which receives the stats so that they get properly aggregated
also modify the existing aggregator to be a stats agregator
also modified the naming import for `StatsFlusher`
it doesnt need the flushers to work, so removing that from it, and spawning own tasks for the data channels
it seems adding `prost::Message` import allows us to have the methods directly from the message we are treating with
@duncanista duncanista marked this pull request as ready for review January 31, 2025 22:01
@duncanista duncanista requested a review from a team as a code owner January 31, 2025 22:01
trace_aggregator: Arc<Mutex<trace_aggregator::TraceAggregator>>,
trace_processor: Arc<dyn trace_processor::TraceProcessor + Send + Sync>,
trace_flusher: Arc<dyn trace_flusher::TraceFlusher + Send + Sync>,
stats_aggregator: Arc<Mutex<stats_aggregator::StatsAggregator>>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these types are becoming a pain to handle. Can we start using type aliases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? We'd have to define them at the top for all of them, maybe not in this PR.

buffer: Vec<SendData>,
}

impl Default for TraceAggregator {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all this file is duplicate of trace stats aggregator, maybe dedup?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, this one has a different type, and they have different ways of handling how the data is treated.

Trace payload the length in the struct, whereas Stats Payload is a proto where we use method from the trait Message to get the length of the payload.

@duncanista duncanista merged commit 3da2b9d into main Feb 4, 2025
23 checks passed
@duncanista duncanista deleted the jordan.gonzalez/traces-aggregator branch February 4, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants